// 1 + 1/2! + 1/3! + ... + 1/n!

#include <iostream>

int main()
{
	int n = 1;

	std::cout << "Enter number: n = ";

	do
	{
		std::cin >> n;
	}
	while(n <= 0);

	double sum = 1;

	std::cout << "1";

	for(int i = 2; i <= n; ++i)
	{
		int factorial = 1;

		for(int j = 2; j <= i; ++j)
			factorial *= j;

		sum += 1 / (double)factorial;

		std::cout << " + 1/" << i << "!";
	}

	std::cout << " = " << sum << std::endl;

	return 0;
}
